﻿using NLog;
using Scap.Data;
using Scap.Info;
using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Scap.Core
{
    public class ServerHandler
    {
        private static Logger logger = LogManager.GetCurrentClassLogger();



        public static void Run()
        {
            logger.Info("Inicializando servicio SCAP...");
            SchedulerHandler scheduler = new SchedulerHandler();
            scheduler.Run();
            DeviceMonitor deviceMonitor = new DeviceMonitor();
            deviceMonitor.Run();
            logger.Info("Inicializando servicio SCAP...[OK]");

            logger.Info("Digite EXIT para detener el servicio SCAP.");            
            while (!Console.ReadLine().Trim('\r').Trim('\n').Trim().ToUpper().Equals("EXIT")) ;
            logger.Info("Finalizando servicio SCAP...[OK]");
        }        
    }
}
